home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 18 / CU Amiga Magazine's Super CD-ROM 18 (1997)(EMAP Images)(GB)[!][issue 1998-01].iso / CUCD / Online / hsc / docs-source / project / makefile.hsc < prev    next >
Encoding:
Makefile  |  1997-10-19  |  3.8 KB  |  131 lines

  1. <WEBPAGE chapter="hsc - Project Management - " title="Makefile"
  2.     BACK="index.html"
  3.     PREV="make.html"
  4.     NEXT="hscdepp.html">
  5.  
  6. Inside the <FILE>starter-project</FILE>-drawer, you can find an rather empty
  7. <A HREF=":../starter-project/source/Makefile"><makefile></A>
  8. to be used for new projects. This will be a short explanation
  9. of the symbols and rules defined in this <makefile>.
  10.  
  11. <H2>Symbols</H2>
  12.  
  13. <PRE>
  14. DESTDIR =/docs/
  15. IGNORE  =ign=46
  16. PRJFILE =hsc.project
  17. STDINC  =inc/my_macros.hsc
  18. HSCMISC =rplcent
  19. </PRE>
  20.  
  21. <P><CODE>DESTDIR</CODE> describes the destination-directory for your
  22. html-objects and is relative to the path where you invoke <make> (and
  23. usually your hsc-sources are located, too). <CODE>IGNORE</CODE>
  24. specifies which messages should be ignored,
  25. <CODE>PRJFILE</CODE> is the project-file to be used both by <hsc> and
  26. <hscdepp>. <CODE>STDINC</CODE> specifies include-files which should
  27. be processed within the command-call invoking <hsc> from the
  28. <makefile>; these files will be included for all hsc-sources.
  29. <CODE>HSCMISC</CODE> contains all other options and switches that
  30. should be passed to <hsc>.</P>
  31.  
  32. <PRE>
  33. HSC     =hsc
  34. HSCFLAGS=$(HSCMISC) $(IGNORE) prjfile=$(PRJFILE) to=$(DESTDIR) $(STDINC)
  35. </PRE>
  36.  
  37. <P><CODE>HSC</CODE> is the command to be used to invoke <hsc>; if it isn't
  38. already in your search-path, you can also enter the full path here.
  39. <CODE>HSCFLAGS</CODE> is computed from the values above and contains
  40. all parameters for <hsc>, exept the main hsc-source.</P>
  41.  
  42. <PRE>
  43. HSCDEPP =hscdepp
  44. </PRE>
  45.  
  46. <P>This is the command to be used to invoke <hscdepp>.</P>
  47.  
  48. <H2>Rules</H2>
  49. <$source PRE>
  50. $(DESTDIR)%.html : %.hsc
  51.         $(HSC) $(HSCFLAGS) $<
  52. </$source>
  53.  
  54. <P>This is a pattern rule that will create a html-object in
  55. <CODE>DESTDIR</CODE> using the corresponding hsc-source and the
  56. options you specified above. The automatic variable
  57. "<CODE>$<</CODE>" contains the name of the first dependency,
  58. normally this is the main hsc-source.</P>
  59.  
  60. <$source PRE>
  61. depend :
  62.         $(HSCDEPP) file=Makefile prjfile=$(PRJFILE) verbose
  63. </$source>
  64.  
  65. <P>This rule will invoke <hscdepp> and update your dependencies; this
  66. will modify your <makefile>.</P>
  67.  
  68. <$source PRE>
  69. NEW :
  70.         $(HSC) $(HSCFLAGS) $(INCLUDE) from=$(FILE)
  71. </$source>
  72.  
  73. <P>This rule can be useful to add new files to the project. You can
  74. also use it to change the include-dependencies of an already existing
  75. file. This just updates the project-file, but not the <makefile>, so
  76. make sure to invoke <KBD>make depend</KBD> afterwards.</P>
  77.  
  78. <P>For example, you could use</P>
  79.  
  80. <PRE>
  81.        make NEW FILE=newfile.hsc
  82. </PRE>
  83.  
  84. <P>to add <FILE>newfile.hsc</FILE> to the project.</P>
  85.  
  86. <H2>Pre- And Post Processing</H2>
  87.  
  88. <P>A fine thing about the pattern rule used above to create your
  89. html-object is that it can be extended to do several things
  90. before or after <hsc> performes its task.</P>
  91.  
  92. <P>For example, extending it to</P>
  93.  
  94. <$source PRE>
  95. $(DESTDIR)%.html : %.hsc
  96.         $(HSC) $(HSCFLAGS) $<
  97.         chmod 644 $@
  98. </$source>
  99.  
  100. <P>will make sure that the file-permission-bits are set to the usual
  101. value required by w3-documents. This, of course, works only for
  102. Unixoid systems.</P>
  103.  
  104. <P>If you are using AmigaOS and have AWeb running, you can use</P>
  105.  
  106. <$source PRE>
  107. $(DESTDIR)%.html : %.hsc
  108.         $(HSC) $(HSCFLAGS) $<
  109.         rx SendBrowser.rexx $@
  110. </$source>
  111.  
  112. <P>to immediately display updated documents in your browser. The
  113. Rexx-Script <A
  114. HREF=":../grafflwerk/SendBrowser.rexx">SendBrowser.rexx</A> can be
  115. found in the <FILE>grafflwerk</FILE>-drawer of the hsc-archive.</P>
  116.  
  117. <P>You can also use a better syntax checker than <hsc> on your newly
  118. created document:</P>
  119.  
  120. <$source PRE>
  121. $(DESTDIR)%.html : %.hsc
  122.         $(HSC) $(HSCFLAGS) $<
  123.         CheckHTLM $@
  124. </$source>
  125.  
  126. <P>Note that errors found during the second check are reported from
  127. the html object and might be a bit difficult to backtrace in the hsc
  128. source.</P>
  129.  
  130. </WEBPAGE>
  131.